.class public abstract Lcom/instagram/creation/video/e/p;
.super Lcom/instagram/creation/base/f;
.source "VideoFilter.java"


# instance fields
.field protected a:I

.field protected b:I

.field protected final c:Landroid/content/Context;

.field protected d:I

.field protected e:Ljava/nio/FloatBuffer;

.field protected f:Ljava/nio/FloatBuffer;


# direct methods
.method public constructor <init>(Landroid/content/Context;ILjava/lang/String;Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 36
    invoke-direct {p0, p2, p3, p4}, Lcom/instagram/creation/base/f;-><init>(ILjava/lang/String;Ljava/lang/String;)V

    .line 37
    iput-object p1, p0, Lcom/instagram/creation/video/e/p;->c:Landroid/content/Context;

    .line 38
    return-void
.end method


# virtual methods
.method protected a()V
    .locals 0

    .prologue
    .line 65
    return-void
.end method

.method public a(I)V
    .locals 6
    .parameter

    .prologue
    const/16 v2, 0x1406

    const/16 v4, 0x8

    const/4 v1, 0x2

    const/4 v3, 0x0

    .line 71
    invoke-virtual {p0}, Lcom/instagram/creation/video/e/p;->c()I

    move-result v0

    invoke-static {v0}, Landroid/opengl/GLES20;->glUseProgram(I)V

    .line 73
    const v0, 0x84c0

    invoke-static {v0}, Landroid/opengl/GLES20;->glActiveTexture(I)V

    .line 74
    const/16 v0, 0xde1

    invoke-static {v0, p1}, Landroid/opengl/GLES20;->glBindTexture(II)V

    .line 76
    iget v0, p0, Lcom/instagram/creation/video/e/p;->b:I

    iget-object v5, p0, Lcom/instagram/creation/video/e/p;->e:Ljava/nio/FloatBuffer;

    invoke-static/range {v0 .. v5}, Landroid/opengl/GLES20;->glVertexAttribPointer(IIIZILjava/nio/Buffer;)V

    .line 78
    iget v0, p0, Lcom/instagram/creation/video/e/p;->a:I

    iget-object v5, p0, Lcom/instagram/creation/video/e/p;->f:Ljava/nio/FloatBuffer;

    invoke-static/range {v0 .. v5}, Landroid/opengl/GLES20;->glVertexAttribPointer(IIIZILjava/nio/Buffer;)V

    .line 81
    invoke-virtual {p0}, Lcom/instagram/creation/video/e/p;->b()V

    .line 83
    const/4 v0, 0x5

    const/4 v1, 0x4

    invoke-static {v0, v3, v1}, Landroid/opengl/GLES20;->glDrawArrays(III)V

    .line 84
    return-void
.end method

.method public a(Ljava/nio/FloatBuffer;)V
    .locals 0
    .parameter

    .prologue
    .line 87
    iput-object p1, p0, Lcom/instagram/creation/video/e/p;->e:Ljava/nio/FloatBuffer;

    .line 88
    return-void
.end method

.method protected b()V
    .locals 0

    .prologue
    .line 68
    return-void
.end method

.method public b(Ljava/nio/FloatBuffer;)V
    .locals 0
    .parameter

    .prologue
    .line 91
    iput-object p1, p0, Lcom/instagram/creation/video/e/p;->f:Ljava/nio/FloatBuffer;

    .line 92
    return-void
.end method

.method public final c()I
    .locals 4

    .prologue
    .line 41
    iget v0, p0, Lcom/instagram/creation/video/e/p;->d:I

    if-nez v0, :cond_0

    .line 43
    :try_start_0
    invoke-virtual {p0}, Lcom/instagram/creation/video/e/p;->getId()I

    move-result v0

    invoke-static {v0}, Lcom/instagram/creation/video/jni/VideoBridge;->compileProgram(I)I

    move-result v0

    iput v0, p0, Lcom/instagram/creation/video/e/p;->d:I

    .line 45
    iget v0, p0, Lcom/instagram/creation/video/e/p;->d:I

    invoke-static {v0}, Landroid/opengl/GLES20;->glUseProgram(I)V

    .line 47
    iget v0, p0, Lcom/instagram/creation/video/e/p;->d:I

    const-string v1, "image"

    invoke-static {v0, v1}, Landroid/opengl/GLES20;->glGetUniformLocation(ILjava/lang/String;)I

    move-result v0

    const/4 v1, 0x0

    invoke-static {v0, v1}, Landroid/opengl/GLES20;->glUniform1i(II)V

    .line 49
    iget v0, p0, Lcom/instagram/creation/video/e/p;->d:I

    const-string v1, "position"

    invoke-static {v0, v1}, Landroid/opengl/GLES20;->glGetAttribLocation(ILjava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/instagram/creation/video/e/p;->b:I

    .line 50
    iget v0, p0, Lcom/instagram/creation/video/e/p;->b:I

    invoke-static {v0}, Landroid/opengl/GLES20;->glEnableVertexAttribArray(I)V

    .line 52
    iget v0, p0, Lcom/instagram/creation/video/e/p;->d:I

    const-string v1, "inputTextureCoordinate"

    invoke-static {v0, v1}, Landroid/opengl/GLES20;->glGetAttribLocation(ILjava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/instagram/creation/video/e/p;->a:I

    .line 53
    iget v0, p0, Lcom/instagram/creation/video/e/p;->a:I

    invoke-static {v0}, Landroid/opengl/GLES20;->glEnableVertexAttribArray(I)V

    .line 55
    invoke-virtual {p0}, Lcom/instagram/creation/video/e/p;->a()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 59
    :goto_0
    const-string v0, "VideoFilter"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Using "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {p0}, Lcom/instagram/creation/video/e/p;->getName()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " program: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget v2, p0, Lcom/instagram/creation/video/e/p;->d:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/facebook/e/a/a;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 61
    :cond_0
    iget v0, p0, Lcom/instagram/creation/video/e/p;->d:I

    return v0

    .line 56
    :catch_0
    move-exception v0

    .line 57
    const-string v1, "VideoFilter"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "Error initializing "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {p0}, Lcom/instagram/creation/video/e/p;->getName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, " program: "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2, v0}, Lcom/facebook/e/a/a;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    goto :goto_0
.end method

.method protected finalize()V
    .locals 1

    .prologue
    .line 96
    iget v0, p0, Lcom/instagram/creation/video/e/p;->d:I

    if-eqz v0, :cond_0

    .line 97
    iget v0, p0, Lcom/instagram/creation/video/e/p;->d:I

    invoke-static {v0}, Landroid/opengl/GLES20;->glDeleteProgram(I)V

    .line 99
    :cond_0
    return-void
.end method

.method public toString()Ljava/lang/String;
    .locals 1

    .prologue
    .line 102
    invoke-virtual {p0}, Lcom/instagram/creation/video/e/p;->getName()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method
